# -*- coding: iso-8859-1 -*-

"""
Catanyste - Copyright 2008-2009 Julien RAIGNEAU
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance 
with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed 
on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for 
the specific language governing permissions and limitations under the License. 
"""

import os
import sys
import unittest

"""
PYUNIT

http://pyunit.sourceforge.net/pyunit.html#SIMPLECASE

"""


#ugly hack but quick and efficient !
#adapt to your src location
sources='/home/tifauve/Documents/Code/Python/catanyste'
sys.path.append(sources + '/src')
from gamecomponents import GameComponents

class DefaultGameComponentTestCase(unittest.TestCase):
    def runTest(self):
        #testing resource_fields with player = 4
        compo = GameComponents()
        assert compo.resource_fields ==  {GameComponents.EARTH_FIELDS:{
                                     GameComponents.LUMBER:4,
                                     GameComponents.BRICK:3,
                                     GameComponents.WOOL:4,
                                     GameComponents.GRAIN:4,
                                     GameComponents.ORE:3,
                                     GameComponents.DESERT:1},
                                     GameComponents.SEA_FIELDS:{
                                     GameComponents.WATER:9,
                                     GameComponents.PORT3:4,
                                     GameComponents.PORT2:{
                                         GameComponents.PORT2LUMBER:1,
                                         GameComponents.PORT2BRICK:1,
                                         GameComponents.PORT2WOOL:1,
                                         GameComponents.PORT2GRAIN:1,
                                         GameComponents.PORT2ORE:1}}}


if __name__ == "__main__":
    unittest.main()
